﻿namespace DataGeneration.Makers
{
    public static class Extensions
    {
        public static string[] GetAnswers(this Question q)
        {
            return new string[] { q.answer1, q.answer2, q.answer3, q.answer4 };
        }

        public static void SetAnswers(this Question q, params string[] answers)
        {
            switch (answers.Length)
            {
                case 4:
                    q.answer4 = answers[3];
                    goto case 3;
                case 3:
                    q.answer3 = answers[2];
                    goto case 2;
                case 2:
                    q.answer2 = answers[1];
                    goto case 1;
                case 1:
                    q.answer1 = answers[0];
                    break;
                default:
                    break;

            }
        }
    }
}